Optimal. Leaf size=55 \[ -\frac{2 i a^2}{f (c-i c \tan (e+f x))}+\frac{i a^2 \log (\cos (e+f x))}{c f}-\frac{a^2 x}{c} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.115864, antiderivative size = 55, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 3, integrand size = 31, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.097, Rules used = {3522, 3487, 43} \[ -\frac{2 i a^2}{f (c-i c \tan (e+f x))}+\frac{i a^2 \log (\cos (e+f x))}{c f}-\frac{a^2 x}{c} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3522
Rule 3487
Rule 43
Rubi steps
\begin{align*} \int \frac{(a+i a \tan (e+f x))^2}{c-i c \tan (e+f x)} \, dx &=\left (a^2 c^2\right ) \int \frac{\sec ^4(e+f x)}{(c-i c \tan (e+f x))^3} \, dx\\ &=\frac{\left (i a^2\right ) \operatorname{Subst}\left (\int \frac{c-x}{(c+x)^2} \, dx,x,-i c \tan (e+f x)\right )}{c f}\\ &=\frac{\left (i a^2\right ) \operatorname{Subst}\left (\int \left (\frac{1}{-c-x}+\frac{2 c}{(c+x)^2}\right ) \, dx,x,-i c \tan (e+f x)\right )}{c f}\\ &=-\frac{a^2 x}{c}+\frac{i a^2 \log (\cos (e+f x))}{c f}-\frac{2 i a^2}{f (c-i c \tan (e+f x))}\\ \end{align*}
Mathematica [B] time = 1.50745, size = 130, normalized size = 2.36 \[ -\frac{a^2 (\cos (e+3 f x)+i \sin (e+3 f x)) \left (\cos (e+f x) \left (-i \log \left (\cos ^2(e+f x)\right )+4 f x+2 i\right )+\sin (e+f x) \left (-\log \left (\cos ^2(e+f x)\right )-4 i f x-2\right )-2 \tan ^{-1}(\tan (3 e+f x)) (\cos (e+f x)-i \sin (e+f x))\right )}{2 c f (\cos (f x)+i \sin (f x))^2} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.025, size = 46, normalized size = 0.8 \begin{align*} 2\,{\frac{{a}^{2}}{cf \left ( \tan \left ( fx+e \right ) +i \right ) }}-{\frac{i{a}^{2}\ln \left ( \tan \left ( fx+e \right ) +i \right ) }{cf}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: RuntimeError} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 1.43316, size = 99, normalized size = 1.8 \begin{align*} \frac{-i \, a^{2} e^{\left (2 i \, f x + 2 i \, e\right )} + i \, a^{2} \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right )}{c f} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A] time = 1.46334, size = 56, normalized size = 1.02 \begin{align*} \frac{2 a^{2} \left (\begin{cases} - \frac{i e^{2 i f x}}{2 f} & \text{for}\: f \neq 0 \\x & \text{otherwise} \end{cases}\right ) e^{2 i e}}{c} + \frac{i a^{2} \log{\left (e^{2 i f x} + e^{- 2 i e} \right )}}{c f} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] time = 1.40319, size = 171, normalized size = 3.11 \begin{align*} -\frac{\frac{2 i \, a^{2} \log \left (\tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right ) + i\right )}{c} - \frac{i \, a^{2} \log \left ({\left | \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right ) + 1 \right |}\right )}{c} - \frac{i \, a^{2} \log \left ({\left | \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right ) - 1 \right |}\right )}{c} + \frac{-3 i \, a^{2} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{2} + 10 \, a^{2} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right ) + 3 i \, a^{2}}{c{\left (\tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right ) + i\right )}^{2}}}{f} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]